<?php echo $html->css('default',NULL,array(),false) ?>
<?php echo $html->css('form_style',NULL,array(),false) ?>
<?php echo $javascript->link('prototype-1.6.0.3.js'); ?>
<div id="columnA">
    <h3>Agregar Campo</h3>
    <?php
    echo 'Los campos marcados con (*) son obligatorios.';
    echo $form->create('Predio',array('action'=>'agregar/'.$productor['Productor']['id']));
    echo'<div class="separator"><span>Domicilio de la Explotacion</span></div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.dom_pred',array('label'=>'*Domicilio (Calle/Ruta, N&deg;/Km): ','div'=>false,'class'=>'inputstyle input350'));
    echo '</div>';
    echo '<div class="form_row">';
    echo 'Localización Catastral ';
    echo $html->link('?',array('controller'=>'departamentos','action'=>'codigos_catastrales'),array('title'=>'¿Qué es esto?','target'=>'blank'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.dpto_pred',array('label'=>'*Departamento: ','div'=>false,'class'=>'inputstyle input20'));
    echo $form->input('Predio.circ_pred',array('label'=>'*Circunscripción: ','div'=>false,'class'=>'inputstyle input30'));
    echo $form->input('Predio.secc_pred',array('label'=>'*Sección: ','div'=>false,'class'=>'inputstyle input20'));
    echo $form->input('Predio.ch_pred',array('label'=>'*Chacra: ','div'=>false,'class'=>'inputstyle input50'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.qta_pred',array('label'=>'*Quinta: ','div'=>false,'class'=>'inputstyle input50'));
    echo $form->input('Predio.fracc_pred',array('label'=>'*Fracción: ','div'=>false,'class'=>'inputstyle input50'));
    echo $form->input('Predio.mz_pred',array('label'=>'*Manzana: ','div'=>false,'class'=>'inputstyle input50'));
    echo $form->input('Predio.parc_pred',array('label'=>'*Parcela: ','div'=>false,'class'=>'inputstyle input50'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Departamento.provincia_id',array('label'=> '*Provincia: ','div'=>false,'class'=>'inputstyle','id'=>'provincias','type'=>'select','empty'=>'Seleccione'));
    echo $form->input('Localidad.departamento_id',array('label'=> '*Departamento: ','div'=>false,'class'=>'inputstyle input270','id'=>'departamentos','type'=>'select','empty'=>'Seleccione'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.localidad_id',array('label'=> '*Localidad: ','div'=>false,'class'=>'inputstyle input240','id'=>'localidades','type'=>'select','empty'=>'Seleccione'));
    echo $form->input('Predio.col_paraje_pred',array('label'=>'Colonia: ','div'=>false,'class'=>'inputstyle input250'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.sup_pred',array('label'=>'*Superficie total (has): ','div'=>false,'class'=>'inputstyle input80'));
    echo $form->input('Predio.sup_cultivable_pred',array('label'=>'Superficie agricola (has): ','div'=>false,'class'=>'inputstyle input60'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.sup_ganadera_pred',array('label'=>'Superficie ganadera (has): ','div'=>false,'class'=>'inputstyle input60'));
    echo $form->input('Predio.sup_boscosa_pred',array('label'=>'Superficie boscosa (has): ','div'=>false,'class'=>'inputstyle input60'));
    echo '</div>';
    echo'<div class="separator"><span>Detalles del Campo</span></div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.nombre_pred',array('label'=>'*Nombre del Campo/Estancia: ','div'=>false,'class'=>'inputstyle input270'));
    echo $form->input('Predio.renspa_pred',array('label'=>'*RENSPA: ','div'=>false,'class'=>'inputstyle input100'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.lat_grados_pred',array('label'=>'Latitud grados: ','div'=>false,'class'=>'inputstyle','type'=>'select','options'=>$gradosLatitud,'empty'=>''));
    echo $form->input('Predio.lat_min_pred',array('label'=>'min:','div'=>false,'class'=>'inputstyle','type'=>'select','options'=>$minutos,'empty'=>''));
    echo $form->input('Predio.lat_seg_pred',array('label'=>'seg:','div'=>false,'class'=>'inputstyle input60'));
    echo $form->input('Predio.long_grados_pred',array('label'=>'Longitud grados:','div'=>false,'class'=>'inputstyle','type'=>'select','options'=>$gradosLongitud,'empty'=>''));
    echo $form->input('Predio.long_min_pred',array('label'=>'min:','div'=>false,'class'=>'inputstyle','type'=>'select','options'=>$minutos,'empty'=>''));
    echo $form->input('Predio.long_seg_pred',array('label'=>'seg:','div'=>false,'class'=>'inputstyle input60'));
    echo '</div>';
    echo '<div class="form_row">';
    echo $form->input('Predio.tenenciatipo_id', array('label' => '*Tenencia: ','div'=>false,'class'=>'inputstyle'));
    //echo $html->link('Agregar Regimen', '/tenenciatipos/agregar');
    echo $form->input('Predio.titular_pred',array('label'=>'Titular: ','div'=>false,'class'=>'inputstyle input240'));
    echo $form->input('Predio.titular_dni_pred',array('label'=>'DNI: ','div'=>false,'class'=>'inputstyle input80'));
    echo '</div>';
    echo $form->button('Cancelar',array('onclick'=>'javascript:window.location="/sistemaagricola/productores/ver/'.$productor['Productor']['id'].'"'));
    echo $form->submit('Guardar',array('div'=>false));
    echo $form->end();

    $options2 = array('url' => 'update_dpto','update' => 'departamentos');
    echo $ajax->observeField('provincias',$options2);
    $options = array('url' => 'update_loc','update' => 'localidades');
    echo $ajax->observeField('departamentos',$options);
    ?>
</div>